package com.gpagers.listener;

import java.io.IOException;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.gpagers.tools.GlobalConfigHolder;


/**
 * 
 * @author van
 * @time 2014年9月10日 下午4:03:43
 */
public class StartupListener implements ServletContextListener {
	private static Logger logger = LoggerFactory
			.getLogger(StartupListener.class);

	public void contextDestroyed(ServletContextEvent event) {
	}

	public void contextInitialized(ServletContextEvent event) {
		logger.info("系统初始化中....");
		try {
			initSys();
		} catch (Exception e) {
			logger.error("启动触发器出错！");
			e.printStackTrace();
		}
		logger.info("系统初始化完成.");
	}

	private void initSys() throws IOException {
		GlobalConfigHolder.init();
	}

}
